package com.central.rearService.controller

import com.central.common.annotation.LoginUser
import com.central.common.model.CommonResult
import com.central.common.model.SysUser
import com.central.rearService.service.VisitService
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.*
import springfox.documentation.annotations.ApiIgnore

/**
 * @author  fly
 * @date  2021/5/26 14:55
 * @version 1.0
 */
@Api(tags = ["(小程序) 来访模块"])
@RestController
@RequestMapping("visit")
open class VisitController {

    @Autowired
    private lateinit var visitService: VisitService


    @ApiOperation("(小程序) 添加来访者")
    @PostMapping("saveVisit")
    fun saveVisit(visitUserId: Long, @LoginUser sysUser: SysUser): CommonResult<Boolean> = visitService.saveVisit(visitUserId, sysUser)


    @ApiOperation("(rpc) 获取我的来访者用户列表id")
    @GetMapping("getMyVisitUserId/{userId}")
    fun getMyVisitUserId(@PathVariable userId: Long): List<String>? = visitService.getMyVisitUserId(userId)

}